home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-06-15 | 1.4 KB | 64 lines | [TEXT/MPS ] |
- (*
- TCPRelease(connectionID) -- Release the TCP stream, including the buffer.
-
- To compile and link this file using Macintosh Programmer's Workshop,
-
- pascal -w TCPRelease.p
- link -m ENTRYPOINT -o HyperCommands -rt XCMD=7862 -sn Main=TCPRelease ∂
- TCPRelease.p.o "{Libraries}HyperXLib.o" "{MPW}"Libraries:interface.o
-
- © Copyright 1988 by Apple Computer, Inc.
-
- Initial coding 12/88 by Harry R. Chesley.
- *)
-
- {$R-}
-
- {$S TCPRelease } { Segment name must be the same as the command name. }
-
- unit DummyUnit;
-
- interface
-
- uses MemTypes, QuickDraw, OSIntf, HyperXCmd;
-
- procedure EntryPoint(paramPtr: XCmdPtr);
-
- implementation
-
- procedure TCPRelease(paramPtr: XCmdPtr); forward;
-
- procedure EntryPoint(paramPtr: XCmdPtr);
-
- begin
- TCPRelease(paramPtr);
- end;
-
- procedure TCPRelease(paramPtr: XCmdPtr);
-
- var releaseFailed: boolean;
-
- procedure Fail(errMsg: Str255); { set theResult and quit }
- begin
- paramPtr^.returnValue := PasToZero(paramPtr,errMsg);
- exit(TCPRelease);
- end;
-
- {$I TCPUtil.inc}
-
- begin
- if paramPtr^.paramCount <> 1 then Fail('§§§ parameter count is not 1 §§§');
-
- SetUpConnectionID;
-
- { Issue a release command. }
- ZeroIOParms;
- SyncControlBlock.csCode := TCPcsRelease;
- releaseFailed := PBControl(@SyncControlBlock,false) <> noErr;
- Connection^.magic := '????';
- if releaseFailed then Fail('§§§ release failed §§§')
- else DisposPtr(Ptr(Connection));
- end;
-
- end.
-